package com.woniu.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author zhaolei
 * @date 2021/4/17 - 21:42
 */
@Controller
@RequestMapping(value = "/he")
public class HelloController {
    @RequestMapping(value = "/hello001")
    public ModelAndView hello(){
        ModelAndView modelAndView = new ModelAndView();
        System.out.println("基于注解的SpringMVC的hello方法");
        modelAndView.setViewName("/nihao.jsp");
        return modelAndView;
    }
    @RequestMapping(value = "/hola")
    public ModelAndView hola(){
        ModelAndView modelAndView = new ModelAndView();
        System.out.println("基于注解的SpringMvc的hola方法");
        modelAndView.setViewName("/welcome.jsp");
        return modelAndView;
    }
}
